<?php 

class Users extends CI_Model {

/*
    var $iduser   = '';
    var $name   = '';
    var $address   = '';
    var $email = '';
    var $username    = '';
    var $password    = '';
    var $info    = '';
*/
    function __construct()
    {
        // Call the Model constructor
        parent::__construct();
    }
    
  	 function load_by_username($username_to_load)
    {
        $this->db->where('username', $username_to_load);  
        $query = $this->db->get('users');
        if( count($query->result()) == 0)
        {
        	  return FALSE;
        }
        
        else 
        {
        		$result_list = $query->result();
        		return $result_list[0];
        }
    }	    
  	 function load_by_id($id_to_load)
    {
        $this->db->where('iduser', $id_to_load);  
        $query = $this->db->get('users');
        if( count($query->result()) == 0)
        {
        	  return FALSE;
        }
        
        else 
        {
        		$result_list = $query->result();
        		return $result_list[0];
        }
    }	    
    function update($userdata)
    {        return "";
    }	
    
    function create($userdata)
    {        return "";
    }	
    

}